package com.credit.management.system.generator.dao;

import com.credit.management.system.model.CompanyGuarante;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.ResultMap;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

public interface CompanyGuaranteMapper {
    @Delete({
        "delete from company_guarante",
        "where id = #{id,jdbcType=INTEGER}"
    })
    int deleteByPrimaryKey(Integer id);

    @Insert({
        "insert into company_guarante (id, cid, ",
        "galegalpersonname, galegalpersonidcard, ",
        "garegisteredcapital, gacompanyprofile, ",
        "gaphone, gacompanyaddress)",
        "values (#{id,jdbcType=INTEGER}, #{cid,jdbcType=INTEGER}, ",
        "#{galegalpersonname,jdbcType=VARCHAR}, #{galegalpersonidcard,jdbcType=VARCHAR}, ",
        "#{garegisteredcapital,jdbcType=DECIMAL}, #{gacompanyprofile,jdbcType=VARCHAR}, ",
        "#{gaphone,jdbcType=VARCHAR}, #{gacompanyaddress,jdbcType=VARCHAR})"
    })
    int insert(CompanyGuarante record);

    int insertSelective(CompanyGuarante record);

    @Select({
        "select",
        "id, cid, galegalpersonname, galegalpersonidcard, garegisteredcapital, gacompanyprofile, ",
        "gaphone, gacompanyaddress",
        "from company_guarante",
        "where id = #{id,jdbcType=INTEGER}"
    })
    @ResultMap("com.credit.management.system.generator.dao.CompanyGuaranteMapper.BaseResultMap")
    CompanyGuarante selectByPrimaryKey(Integer id);

    int updateByPrimaryKeySelective(CompanyGuarante record);

    @Update({
        "update company_guarante",
        "set cid = #{cid,jdbcType=INTEGER},",
          "galegalpersonname = #{galegalpersonname,jdbcType=VARCHAR},",
          "galegalpersonidcard = #{galegalpersonidcard,jdbcType=VARCHAR},",
          "garegisteredcapital = #{garegisteredcapital,jdbcType=DECIMAL},",
          "gacompanyprofile = #{gacompanyprofile,jdbcType=VARCHAR},",
          "gaphone = #{gaphone,jdbcType=VARCHAR},",
          "gacompanyaddress = #{gacompanyaddress,jdbcType=VARCHAR}",
        "where id = #{id,jdbcType=INTEGER}"
    })
    int updateByPrimaryKey(CompanyGuarante record);
}